	&lt;!--- -------------------------------------------------------------------------------------- ---&gt;

	&lt;cffunction name="get<xsl:value-of select="//bean/@name"/>" access="public" output="false" returntype="query"&gt;
		<xsl:for-each select="root/bean/dbtable/column">&lt;cfargument name="<xsl:value-of select="@name" />" type="<xsl:value-of select="@type" />" /&gt;
		<xsl:if test="@primaryKey = 'Yes'">&lt;cfargument name="<xsl:value-of select="@name" />In" type="string" /&gt;
		</xsl:if></xsl:for-each>&lt;cfargument name="orderby" type="string" required="false" /&gt;
		&lt;cfset var local = structNew() /&gt;
		
		&lt;cfquery name="local.get<xsl:value-of select="//bean/@name"/>" datasource="#request.datasource#"&gt;
			SELECT
				<xsl:for-each select="root/bean/dbtable/column"><xsl:value-of select="//dbtable/@name" />.<xsl:value-of select="@name" /><xsl:if test="position() != last()">,
				</xsl:if>
				</xsl:for-each>
			FROM <xsl:value-of select="//dbtable/@name" />
			WHERE 0=0
				<xsl:for-each select="root/bean/dbtable/column"><xsl:if test="@name = 'IsDeleted' or @name = 'isDeleted'">&lt;cfif structKeyExists(arguments,"<xsl:value-of select="@name" />") and len(arguments.<xsl:value-of select="@name" />)<xsl:if test="@cfSqlType = 'cf_sql_timestamp'"> and isDate(arguments.<xsl:value-of select="@name" />)</xsl:if>&gt;
					AND <xsl:value-of select="//dbtable/@name" />.<xsl:value-of select="@name" /> = &lt;cfqueryparam value="#arguments.<xsl:value-of select="@name" />#" CFSQLType="<xsl:value-of select="@cfSqlType" />"<xsl:if test="@cfSqlType = 'cf_sql_varchar'"> maxLength="<xsl:value-of select="@length" />"</xsl:if> /&gt;
				&lt;cfelse&gt;
					AND <xsl:value-of select="//dbtable/@name" />.<xsl:value-of select="@name" /> &lt;&gt; &lt;cfqueryparam value="true" CFSQLType="cf_sql_bit" /&gt;
				&lt;/cfif&gt;
				</xsl:if><xsl:if test="@name != 'IsDeleted' and @name != 'isDeleted'">&lt;cfif structKeyExists(arguments,"<xsl:value-of select="@name" />") and len(arguments.<xsl:value-of select="@name" />)<xsl:if test="@cfSqlType = 'cf_sql_timestamp'"> and isDate(arguments.<xsl:value-of select="@name" />)</xsl:if>&gt;
					AND <xsl:value-of select="//dbtable/@name" />.<xsl:value-of select="@name" /> = &lt;cfqueryparam value="#arguments.<xsl:value-of select="@name" />#" CFSQLType="<xsl:value-of select="@cfSqlType" />"<xsl:if test="@cfSqlType = 'cf_sql_varchar' and @length != '-1'"> maxLength="<xsl:value-of select="@length" />"</xsl:if> /&gt;
				&lt;/cfif&gt;
				</xsl:if><xsl:if test="@primaryKey = 'Yes'">&lt;cfif structKeyExists(arguments,"<xsl:value-of select="@name" />In") and len(arguments.<xsl:value-of select="@name" />In)>
					AND <xsl:value-of select="//dbtable/@name" />.<xsl:value-of select="@name" /> in (&lt;cfqueryparam value="#arguments.<xsl:value-of select="@name" />In#" CFSQLType="cf_sql_integer" list="yes" /&gt;)
				&lt;/cfif&gt;
				</xsl:if></xsl:for-each>
				&lt;cfif structKeyExists(arguments, "orderby") and len(arguments.orderBy)&gt;
					ORDER BY #arguments.orderby#
				&lt;/cfif&gt;
			&lt;/cfquery&gt;
		
		&lt;cfreturn local.get<xsl:value-of select="//bean/@name"/> /&gt;
	&lt;/cffunction&gt;